package com.zhijian.medical.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Api(tags = "常规病例-借还片记录")
public class RoutineSampleBrRecord {

    /**
     * 主键ID
     */
    @ApiModelProperty("主键ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("借还片编号")
    private String brCode;

    @ApiModelProperty("借阅人")
    private String jyr;

    @ApiModelProperty("身份证号")
    private String jyrCard;

    @ApiModelProperty("与患者关系")
    private String patientRelation;

    @ApiModelProperty("联系方式")
    private String relationPhone;

    @ApiModelProperty("押金")
    private String yj;

    @ApiModelProperty("手续费")
    private String sxf;

    @ApiModelProperty("备注")
    private String note;

    @ApiModelProperty("借阅人所属科室")
    private String jyrDept;

    @ApiModelProperty("借片原因")
    private String brReason;

    @ApiModelProperty("借片切片数量")
    @TableField(exist = false)
    private Integer brQpNum;

    @ApiModelProperty("借片切片数据列表")
    private String brQpData;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("修改时间")
    private Date updateTime;

    @ApiModelProperty("病理号")
    private String blh;

    @ApiModelProperty("归还人")
    private String ghr;

    @ApiModelProperty("归还人科室")
    private String ghrDept;

    @ApiModelProperty("归还人联系方式")
    private String ghrRelation;

    @ApiModelProperty("归还备注")
    private String ghNote;

    @ApiModelProperty("归还时间")
    private Date ghDate;

    @ApiModelProperty("借片蜡块数量")
    @TableField(exist = false)
    private Integer lkNum;

    @ApiModelProperty("借还蜡块数据")
    private String brLkData;

    @ApiModelProperty("借阅操作人ID")
    private Long jyOperate;

    @ApiModelProperty("借阅操作人名称")
    private String jyOperater;

    @ApiModelProperty("归还操作人ID")
    private Long ghOperate;

    @ApiModelProperty("还片诊断结果")
    private String diagnoseResult;

    @ApiModelProperty("归还操作人名称")
    private String ghOperater;

    @ApiModelProperty("借阅类型 0 切片 1 蜡块")
    private Integer jyType;

    @ApiModelProperty("借阅状态")
    private Integer jyState;

    public String getJyStateStr(){
        if (jyState != null){
            if (jyState == 0){
                return "借出";
            }
            if (jyState == 1){
                return "部分归还";
            }
            if (jyState == 2){
                return  "归还";
            }
        }
        return "借出";
    }

    @ApiModelProperty("借还片数据")
    @TableField(exist = false)
    private List<String> brDataList;

    @ApiModelProperty("借还片详情数据")
    @TableField(exist = false)
    private List<RoutineSampleBrRecordDetail> detailList;

    @ApiModelProperty("病人名称")
    @TableField(exist = false)
    private String patientName;
}
